//
//  YLProductIntroductionViewController.m
//  YLFinanceService
//
//  Created by she1323 on 2017/10/23.
//  Copyright © 2017年 she1323. All rights reserved.
//  产品介绍

#import "YLProductIntroductionViewController.h"
#import "WHNetworkTool.h"
#import "WHProgressHUD.h"
#import "YLAccountTool.h"
@interface YLProductIntroductionViewController ()

@end

@implementation YLProductIntroductionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    NSDictionary *param = @{@"ProductCode" : _productCode};
    
    self.title = @"产品介绍";
    
    NSString *url = [NSString stringWithFormat:@"%@Product/PGetProductIntroduce", YLURL];
    
    __weak typeof(self) weakSelf = self;
    [WHProgressHUD showStatus:@"正在获取产品介绍..."];
    [[WHNetworkTool shareInstance] sendPostWithUrl:url header:[YLAccountTool header] params:param success:^(id responseObject) {
        [WHProgressHUD dismiss];
        if ([responseObject[@"httpCode"] integerValue] == 200) {
            NSDictionary *dict = responseObject[@"httpResult"];
            if ([dict[@"introduce"] isKindOfClass:[NSString class]]) {
                NSString *str = dict[@"introduce"];
                weakSelf.contentHtml = str;
            } else {
                [WHProgressHUD showError:@"暂无产品介绍"];
            }
            
            
        } else {
            [WHProgressHUD showError:responseObject[@"message"]];

        }
        
    } fail:^(NSError *error) {
    
    }];
    
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
